#include <stdio.h>
#include <signal.h>

//volatile int flag = 0;
int flag=0;

void handler(int sig)
{
    printf("flag from 0 to 1\n");
    flag = 1;
}

int main()
{
    signal(2, handler);
    while (!flag);
    printf("quit!\n");

    return 0;
}